/*
** dspsupp.c
**
** This module contains function to display supports in Ftool.
**
** TeCGraf - Grupo de Tecnologia em Computacao Grafica - PUC-Rio.
**
**      ---------------------------------------------------------------
**
**	Function : DspSupport(type,p,ang,colour)
**
**	Purpose  : Based on a given point, the support type, size and angle
**		   this routine displays the support on this point.
**
**	Input    : int type     - support type :
**			1 : restrained in only one dir.
**		   	2 : simply supported
**			3 : fixed
**			4 : "Charrior" support
**			5 : "Box" support (theoretical support, 
**			     which fixes only the rotation)
**			6 : translation spring
**			7 : rotation spring
**		   Tpoint* p    - point location
**		   double ang   - Support angle
**                 int colour   - Support colour
**
**      ---------------------------------------------------------------
**
**	Function : DspSpringKxVal(p,kx,color)
**
**	Purpose  : This routine displays the stiffness value
**                 of a horizontal translation spring support.
**
**		   Tpoint* p      - point location
**                 double kx      - stiffness value
**                 int    color   - text color index
**
**      ---------------------------------------------------------------
**
**	Function : DspSpringKyVal(p,ky,color)
**
**	Purpose  : This routine displays the stiffness value
**                 of a vertical translation spring support.
**
**		   Tpoint* p      - point location
**                 double ky      - stiffness value
**                 int    color   - text color index
**
**      ---------------------------------------------------------------
**
**	Function : DspSpringKzVal(p,kz,color)
**
**	Purpose  : This routine displays the stiffness value
**                 of a rotation spring support.
**
**		   Tpoint* p      - point location
**                 double kz      - stiffness value
**                 int    color   - text color index
**
**      ---------------------------------------------------------------
**
** History:
**
** Created 26-FEB-1992	ACV
**			Based on the work developed by
**			Eduardo Corseuil
**			Vinicius Samu
**
** Modified on 16-Feb-2000 by LFMartha.
**      Version 2.06: Created spring supports.
**      Got rid of function DspLineSupp that was not used.
**      Created load value visibility flag: added
**      option to display spring stiffness values.
**      Created functions to display spring stiffness values.
**
** Modified on 11-Jan-2001 by LFMartha.
**      Version 2.09:
**      Created global variable to hold display sizes.
**      Deleted size arguments in display functions.
**
*/

/*
** -------------------------------------------------------------------------
** Global variables and symbols:
*/
#include        <stdio.h>
#include        <math.h>      /* fabs, atan2 */

#if 0

#include	"dsp.h"
#include  "dsp_att.h"
#include	"gra.h"

/*
** -------------------------------------------------------------------------
** Prototypes of local function:
*/
static void DspSupport1 ( Tpoint *, double, double );
static void DspSupport2 ( Tpoint *, double, double );
static void DspSupport3 ( Tpoint *, double, double );
static void DspSupport4 ( Tpoint *, double, double );
static void DspSupport5 ( Tpoint *, double, double );
static void DspSupport6 ( Tpoint *, double, double );
static void DspSupport7 ( Tpoint *, double, double );

/*
** Auxiliary variables for displaying spring support stiffness values.
*/


/*
** ---------------------------------------------------------------
** Public functions:
*/

/* =======================  DspSupport  ==================== */

void DspSupport (
 int	type,		/* Support type					*/
 Tpoint	*p,		/* Point location where the support will be
			   displayed					*/
 double	ang, 		/* Support angle				*/
 int    colour)         /* Support colour                               */
{
  double size = dsp_sizesup;

  GraSetLineColor (colour);

/* According to the support type call the function to display the proper
   support								*/

  switch ( type ) {

      case 1 : DspSupport1 ( p, size, ang );
  	       break;

      case 2 : DspSupport2 ( p, size, ang );
	       break;

      case 3 : DspSupport3 ( p, size, ang );
	       break;

      case 4 : DspSupport4 ( p, size, ang );
	       break;

      case 5 : DspSupport5 ( p, size, ang );
	       break;

      case 6 : DspSupport6 ( p, size, ang );
	       break;

      case 7 : DspSupport7 ( p, size, ang );
	       break;

      default :
	       break;
  }
}



/* =======================  DspSupport  ==================== */

void DspMemberSupport (
 int	   type,		/* Support type					                   */
 int     npts,    /* Number of points that define the curve  */
 Tpoint *pts,     /* points that define the curve            */
 double	 ang, 		/* Support angle				                   */
 double   L,      /*  */
 int     colour)  /* Support colour                          */
{
  double size = dsp_sizesup;
  int         i, n_spaces;

  n_spaces = (int) (L /  (dsp_sizesup*1.4));

  GraSetLineColor (colour);

  // internal narrows
  if (n_spaces > 1)
  {
    double curr_l = 0.0, step_l = 0.0, space_supp = L / (n_spaces*1.0);
    double delta;
    int    curr_supp = 1;
    Tpoint p;
   
    for (i = 0; i < npts-1; i++)
    {
      step_l = sqrt (((pts[i+1].x-pts[i].x) * (pts[i+1].x-pts[i].x)) + 
                     ((pts[i+1].y-pts[i].y) * (pts[i+1].y-pts[i].y)));
      while (((curr_supp*space_supp) > curr_l) &&
             ((curr_supp*space_supp) <= (curr_l + step_l)) )
      {
        delta = (curr_supp*space_supp - curr_l) / step_l;
        p.x = pts[i].x + (pts[i+1].x - pts[i].x) * delta;
        p.y = pts[i].y + (pts[i+1].y - pts[i].y) * delta;

        if ((i == npts-2) && (((curr_supp+1) * space_supp) > (curr_l + step_l)) )
           break;

        switch (type)
        {
          case 1 : DspSupport1 ( &p, size, ang );
  	        break;
          case 2 : DspSupport2 ( &p, size, ang );
	          break;
          case 3 : DspSupport3 ( &p, size, ang );
	          break;
          case 4 : DspSupport4 ( &p, size, ang );
	          break;
          case 5 : DspSupport5 ( &p, size, ang );
	          break;
          case 6 : DspSupport6 ( &p, size, ang );
	          break;
          case 7 : DspSupport7 ( &p, size, ang );
	          break;
          default :
	          break;
        }

        curr_supp++;
      }
 
      curr_l += step_l;
    }
  }

 


/* According to the support type call the function to display the proper
   support								*/


}


/*
** ---------------------------------------------------------------
** Local functions:
** 
*/

/*
**      ---------------------------------------------------------------
**
**	Function : DspSupport1(p,size,ang)
**
**	Purpose  : Based on a given point, the support size and angle
**		   this routine displays at this point a support
**		   restrained in only one direction.
**
**      ---------------------------------------------------------------
**
*/
static void DspSupport1 (
 Tpoint	*p,		/* Point location where the support will be
			   displayed					*/
 double	size,		/* Support size					*/
 double	ang 		/* Support angle				*/
)
{
 Tpoint line1[3],line2[2],line3[2];	/* aux. variables to draw the 	*/
 int    npointsL1,npointsL2,npointsL3;	/* support			*/

/* Build the support (triangle)						*/

   line1 [0].x = ( p->x ) - ( size * 0.33333 );
   line1 [0].y = ( p->y ) - ( size * 0.57735 );
   line1 [1].x = ( p->x );
   line1 [1].y = ( p->y );
   line1 [2].x = ( p->x ) + ( size * 0.33333 );
   line1 [2].y = line1 [0].y;
   npointsL1 = 3;

   line2 [0].x = line1 [0].x - ( size * 0.16666 );
   line2 [0].y = line1 [0].y;
   line2 [1].x = line1 [2].x + ( size * 0.16666 );
   line2 [1].y = line1 [0].y;
   npointsL2 = 2;

   line3 [0].x = line2 [0].x;
   line3 [0].y = line1 [0].y - ( size * 0.2 );
   line3 [1].x = line2 [1].x;
   line3 [1].y = line3 [0].y;
   npointsL3 = 2;

/* Rotate the points to correct position based on the given angle	*/

   DspUtlRotationPoints ( ang, p, line1, npointsL1 );
   DspUtlRotationPoints ( ang, p, line2, npointsL2 );
   DspUtlRotationPoints ( ang, p, line3, npointsL3 );

/* Drawing the support							*/

   GraPolyLine ( npointsL1, line1 );
   GraPolyLine ( npointsL2, line2 );
   GraPolyLine ( npointsL3, line3 );
}


/*
**      ---------------------------------------------------------------
**
**	Function : DspSupport2(p,size,ang)
**
**	Purpose  : Based on a given point, the support size and angle
**		   this routine displays at this point a simply support.
**
**      ---------------------------------------------------------------
**
*/
static void DspSupport2 (
 Tpoint	*p,		/* Point location where the support will be
			   displayed					*/
 double	size,		/* Support size					*/
 double	ang 		/* Support angle				*/
)
{
 Tpoint line1[3],line2[2],linehatch[2];	/* aux. variables to draw the 	*/
 int    npointsL1,npointsL2,npointsLh;	/* support			*/
 Tpoint auxlh[2];
 int    i;

/* Build the support (triangle)						*/

     line1 [0].x = ( p->x ) - ( size * 0.33333 );
     line1 [0].y = ( p->y ) - ( size * 0.57735 );
     line1 [1].x = ( p->x );
     line1 [1].y = ( p->y );
     line1 [2].x = ( p->x ) + ( size * 0.33333 );
     line1 [2].y = line1 [0].y;
     npointsL1 = 3;

     line2 [0].x = line1 [0].x - ( size * 0.16666 );
     line2 [0].y = line1 [0].y;
     line2 [1].x = line1 [2].x + ( size * 0.16666 );
     line2 [1].y = line1 [0].y;
     npointsL2 = 2;

     linehatch [0].x = line2 [0].x + ( size * 0.2 );
     linehatch [0].y = line2 [0].y;
     linehatch [1].x = line2 [0].x;
     linehatch [1].y = line2 [0].y - ( size * 0.2 );
     npointsLh = 2;

/* Rotate the points to correct position based on the given angle	*/

     DspUtlRotationPoints ( ang, p, line1, npointsL1 );
     DspUtlRotationPoints ( ang, p, line2, npointsL2 );

/* Drawing the support							*/

   GraPolyLine ( npointsL1, line1 );
   GraPolyLine ( npointsL2, line2 );

/* Drawing the support hatch						*/

   auxlh [0].x = linehatch [0].x;
   auxlh [0].y = linehatch [0].y;
   auxlh [1].x = linehatch [1].x;
   auxlh [1].y = linehatch [1].y;

   for ( i=1; i<6; i++ ) {

      DspUtlRotationPoints ( ang, p, linehatch, npointsLh );
      GraPolyLine ( npointsLh, linehatch );
      linehatch [0].x = auxlh [0].x + ( size * 0.2 * i );
      linehatch [0].y = auxlh [0].y;
      linehatch [1].x = auxlh [1].x + ( size * 0.2 * i );
      linehatch [1].y = auxlh [1].y;
   }
}


/*
**      ---------------------------------------------------------------
**
**	Function : DspSupport3(p,size,ang)
**
**	Purpose  : Based on a given point, the support size and angle
**		   this routine displays at this point a fixed support.
**
**      ---------------------------------------------------------------
**
*/
static void DspSupport3 (
 Tpoint	*p,		/* Point location where the support will be
			   displayed					*/
 double	size,		/* Support size					*/
 double	ang 		/* Support angle				*/
)
{
 Tpoint line[2],linehatch[2];		/* aux. variables to draw the 	*/
 int    npointsL,npointsLh;		/* support			*/
 Tpoint auxlh[2];
 int    i;

/* Build the support (line)						*/

   line [0].x = ( p->x ) - ( size * 0.5 );
   line [0].y = ( p->y );
   line [1].x = ( p->x ) + ( size * 0.5 );
   line [1].y = ( p->y );
   npointsL = 2;

   linehatch [0].x = line [0].x + ( size * 0.2 );
   linehatch [0].y = line [0].y;
   linehatch [1].x = line [0].x;
   linehatch [1].y = line [0].y - ( size * 0.2 );
   npointsLh = 2;

/* Rotate the points to correct position based on the given angle	*/

   DspUtlRotationPoints ( ang, p, line, npointsL );

/* Drawing the support							*/

   GraPolyLine ( npointsL, line );

/* Drawing the support hatch						*/

   auxlh [0].x = linehatch [0].x;
   auxlh [0].y = linehatch [0].y;
   auxlh [1].x = linehatch [1].x;
   auxlh [1].y = linehatch [1].y;

   for ( i=1; i<6; i++ ) {

     DspUtlRotationPoints ( ang, p, linehatch, npointsLh );
     GraPolyLine ( npointsLh, linehatch );
     linehatch [0].x = auxlh [0].x + ( size * 0.2 * i );
     linehatch [0].y = auxlh [0].y;
     linehatch [1].x = auxlh [1].x + ( size * 0.2 * i );
     linehatch [1].y = auxlh [1].y;
   }
}


/*
**      ---------------------------------------------------------------
**
**	Function : DspSupport4(p,size,ang)
**
**	Purpose  : Based on a given point, the support size and angle
**		   this routine displays at this point a "Charrior"
**		   support.
**
**      ---------------------------------------------------------------
**
*/
static void DspSupport4 (
 Tpoint	*p,		/* Point location where the support will be
			   displayed					*/
 double	size,		/* Support size					*/
 double	ang 		/* Support angle				*/
)
{
 Tpoint line1[2],line2[2],linehatch[4];	/* aux. variables to draw the 	*/
 Tpoint line3[9],line4[9];		/* support			*/
 int    npointsL1,npointsL2,npointsLh;
 int    npointsL3,npointsL4;
 Tpoint auxlh[2];
 int    i;

/* Build the support (two parallel lines and two rolls between them)	*/

   line1 [0].x = ( p->x ) - ( size * 0.5 );
   line1 [0].y = ( p->y );
   line1 [1].x = ( p->x ) + ( size * 0.5 );
   line1 [1].y = ( p->y );
   npointsL1 = 2;

   line2 [0].x = line1 [0].x;
   line2 [0].y = ( p->y ) - ( size * 0.25 );
   line2 [1].x = line1 [1].x;
   line2 [1].y = line2 [0].y;
   npointsL2 = 2;

   line3 [0].x = ( p->x ) - ( size * 0.29167 );
   line3 [0].y = ( p->y );
   line3 [1].x = ( p->x ) - ( size * 0.20833 );
   line3 [1].y = ( p->y );
   line3 [2].x = ( p->x ) - ( size * 0.125 );
   line3 [2].y = ( p->y ) - ( size * 0.08333 );
   line3 [3].x = line3 [2].x;
   line3 [3].y = ( p->y ) - ( size * 0.16667 );
   line3 [4].x = line3 [1].x;
   line3 [4].y = ( p->y ) - ( size * 0.25 );
   line3 [5].x = line3 [0].x;
   line3 [5].y = line3 [4].y;
   line3 [6].x = ( p->x ) - ( size * 0.375 );
   line3 [6].y = line3 [3].y;
   line3 [7].x = line3 [6].x;
   line3 [7].y = line3 [2].y;
   line3 [8].x = line3 [0].x;
   line3 [8].y = line3 [0].y;
   npointsL3 = 9;

   line4 [0].x = ( p->x ) + ( size * 0.29167 );
   line4 [0].y = ( p->y );
   line4 [1].x = ( p->x ) + ( size * 0.20833 );
   line4 [1].y = ( p->y );
   line4 [2].x = ( p->x ) + ( size * 0.125 );
   line4 [2].y = ( p->y ) - ( size * 0.08333 );
   line4 [3].x = line4 [2].x;
   line4 [3].y = ( p->y ) - ( size * 0.16667 );
   line4 [4].x = line4 [1].x;
   line4 [4].y = ( p->y ) - ( size * 0.25 );
   line4 [5].x = line4 [0].x;
   line4 [5].y = line4 [4].y;
   line4 [6].x = ( p->x ) + ( size * 0.375 );
   line4 [6].y = line4 [3].y;
   line4 [7].x = line4 [6].x;
   line4 [7].y = line4 [2].y;
   line4 [8].x = line4 [0].x;
   line4 [8].y = line4 [0].y;
   npointsL4 = 9;

   linehatch [0].x = line2 [0].x + ( size * 0.2 );
   linehatch [0].y = line2 [0].y;
   linehatch [1].x = line2 [0].x;
   linehatch [1].y = line2 [0].y - ( size * 0.2 );
   npointsLh = 2;

/* Rotate the points to correct position based on the given angle	*/

   DspUtlRotationPoints ( ang, p, line1, npointsL1 );
   DspUtlRotationPoints ( ang, p, line2, npointsL2 );
   DspUtlRotationPoints ( ang, p, line3, npointsL3 );
   DspUtlRotationPoints ( ang, p, line4, npointsL4 );

/* Drawing the support							*/

   GraPolyLine ( npointsL1, line1 );
   GraPolyLine ( npointsL2, line2 );
   GraPolyLine ( npointsL3, line3 );
   GraPolyLine ( npointsL4, line4 );

/* Drawing the support hatch						*/
   auxlh [0].x = linehatch [0].x;
   auxlh [0].y = linehatch [0].y;
   auxlh [1].x = linehatch [1].x;
   auxlh [1].y = linehatch [1].y;

   for ( i=1; i<6; i++ ) {

     DspUtlRotationPoints ( ang, p, linehatch, npointsLh );
     GraPolyLine ( npointsLh, linehatch );
     linehatch [0].x = auxlh [0].x + ( size * 0.2 * i );
     linehatch [0].y = auxlh [0].y;
     linehatch [1].x = auxlh [1].x + ( size * 0.2 * i );
     linehatch [1].y = auxlh [1].y;
   }
}


/*
**      ---------------------------------------------------------------
**
**	Function : DspSupport5(p,size,ang)
**
**	Purpose  : Based on a given point, the support size and angle
**		   this routine displays at this point a theoretical
**                 support, which fixes only the rotation. It is drawn
**                 like a "plate".
**
**      ---------------------------------------------------------------
**
*/
static void DspSupport5 (
 Tpoint	*p,		/* Point location where the support will be
			   displayed					*/
 double	size,		/* Support size					*/
 double	ang 		/* Support angle				*/
)
{
 Tpoint line[5];	                /* aux. variables to draw the 	*/
 int    npointsL = 5;		        /* support			*/
 double  sizeplt = 0.75 * size;

/* Build the support (line)						*/

   line [0].x = ( p->x ) - ( sizeplt * 0.5 );
   line [0].y = ( p->y ) - ( sizeplt * 0.5 );
   line [1].x = ( p->x ) + ( sizeplt * 0.5 );
   line [1].y = ( p->y ) - ( sizeplt * 0.5 );
   line [2].x = ( p->x ) + ( sizeplt * 0.5 );
   line [2].y = ( p->y ) + ( sizeplt * 0.5 );
   line [3].x = ( p->x ) - ( sizeplt * 0.5 );
   line [3].y = ( p->y ) + ( sizeplt * 0.5 );
   line [4].x = line [0].x;
   line [4].y = line [0].y;

/* Rotate the points to correct position based on the given angle       */

   DspUtlRotationPoints ( ang, p, line, npointsL );

/* Drawing the support							*/

   GraPolyLine ( npointsL, line );
}


/*
**      ---------------------------------------------------------------
**
**	Function : DspSupport6(p,size,ang)
**
**	Purpose  : Based on a given point, the support size and angle
**		   this routine displays at this point a translation
**                 spring support.
**
**      ---------------------------------------------------------------
**
*/
static void DspSupport6 (
 Tpoint	*p,		/* Point location where the support will be
			   displayed					*/
 double	size,		/* Support size					*/
 double	ang 		/* Support angle				*/
)
{
 Tpoint base[2],basehatch[2];		/* aux. variables to draw the 	*/
 int    npointsB,npointsBh;		/* support			*/
 Tpoint coil[12];
 int    npointsC;
 Tpoint auxlh[2];
 int    i;

/* Build the support body (coil) */

   coil[ 0].x = p->x;
   coil[ 0].y = p->y;
   coil[ 1].x = p->x;
   coil[ 1].y = p->y - ( size * 0.1 );
   coil[ 2].x = p->x + ( size / 5.0 );
   coil[ 2].y = p->y - ( size * 0.15 );
   coil[ 3].x = p->x - ( size / 5.0 );
   coil[ 3].y = p->y - ( size * 0.25 );
   coil[ 4].x = p->x + ( size / 5.0 );
   coil[ 4].y = p->y - ( size * 0.35 );
   coil[ 5].x = p->x - ( size / 5.0 );
   coil[ 5].y = p->y - ( size * 0.45 );
   coil[ 6].x = p->x + ( size / 5.0 );
   coil[ 6].y = p->y - ( size * 0.55 );
   coil[ 7].x = p->x - ( size / 5.0 );
   coil[ 7].y = p->y - ( size * 0.65 );
   coil[ 8].x = p->x + ( size / 5.0 );
   coil[ 8].y = p->y - ( size * 0.75 );
   coil[ 9].x = p->x - ( size / 5.0 );
   coil[ 9].y = p->y - ( size * 0.85 );
   coil[10].x = p->x;
   coil[10].y = p->y - ( size * 0.90 );
   coil[11].x = p->x;
   coil[11].y = p->y - size;
   npointsC = 12;

/* Build the support base */

   base[0].x = p->x - ( size * 0.5 );
   base[0].y = p->y - size;
   base[1].x = p->x + ( size * 0.5 );
   base[1].y = p->y - size;
   npointsB = 2;

   basehatch[0].x = base[0].x + ( size * 0.2 );
   basehatch[0].y = base[0].y;
   basehatch[1].x = base[0].x;
   basehatch[1].y = base[0].y - ( size * 0.2 );
   npointsBh = 2;

/* Rotate the points to correct position based on the given angle	*/

   DspUtlRotationPoints ( ang, p, coil, npointsC );
   DspUtlRotationPoints ( ang, p, base, npointsB );

/* Draw the support							*/

   GraPolyLine ( npointsC, coil );
   GraPolyLine ( npointsB, base );

/* Drawing the support hatch						*/

   auxlh[0].x = basehatch[0].x;
   auxlh[0].y = basehatch[0].y;
   auxlh[1].x = basehatch[1].x;
   auxlh[1].y = basehatch[1].y;

   for ( i=1; i<6; i++ ) {

     DspUtlRotationPoints ( ang, p, basehatch, npointsBh );
     GraPolyLine ( npointsBh, basehatch );
     basehatch[0].x = auxlh[0].x + ( size * 0.2 * i );
     basehatch[0].y = auxlh[0].y;
     basehatch[1].x = auxlh[1].x + ( size * 0.2 * i );
     basehatch[1].y = auxlh[1].y;
   }
}


/*
**      ---------------------------------------------------------------
**
**	Function : DspSupport7(p,size,ang)
**
**	Purpose  : Based on a given point, the support size and angle
**		   this routine displays at this point a rotation
**                 spring support.
**
**      ---------------------------------------------------------------
**
*/
static void DspSupport7 (
 Tpoint	*p,		/* Point location where the support will be
			   displayed					*/
 double	size,		/* Support size					*/
 double	ang 		/* Support angle (NOT USED)			*/
)
{
 Tpoint base[2],basehatch[2];		/* aux. variables to draw the 	*/
 int    npointsB,npointsBh;		/* support			*/
 Tpoint coil[2];
 int    npointsC;
 Tpoint c1, c2;
 Tpoint auxlh[2];
 int    i;

/* Build the support body (coil) */

   /* first circle center: */
   c1.x = p->x;
   c1.y = p->y + ( size * 0.125 );

   /* second circle center: */
   c2.x = p->x + ( size * 0.125 );
   c2.y = p->y + ( size * 0.125 );

   /* coil points: */
   coil[0].x = p->x + ( size * 0.625 );
   coil[0].y = p->y + ( size * 0.125 );
   coil[1].x = p->x + ( size * 0.625 );
   coil[1].y = p->y - ( size * 0.250 );
   npointsC = 2;

/* Build the support base */

   base[0].x = p->x + ( size * 0.3125 );
   base[0].y = p->y - ( size * 0.2500 );
   base[1].x = p->x + ( size * 0.9375 );
   base[1].y = p->y - ( size * 0.2500 );
   npointsB = 2;

   basehatch[0].x = base[0].x + ( size * 0.15 );
   basehatch[0].y = base[0].y;
   basehatch[1].x = base[0].x;
   basehatch[1].y = base[0].y - ( size * 0.15 );
   npointsBh = 2;

/* Draw the support							*/

   GraArc( &c1, 0.125*size, 180.0, 270.0 );
   GraArc( &c2, 0.250*size,   0.0, 180.0 );
   GraArc( &c1, 0.375*size, 180.0, 360.0 );
   GraArc( &c2, 0.500*size,   0.0, 180.0 );
   GraPolyLine ( npointsC, coil );
   GraPolyLine ( npointsB, base );

/* Drawing the support hatch						*/

   auxlh[0].x = basehatch[0].x;
   auxlh[0].y = basehatch[0].y;
   auxlh[1].x = basehatch[1].x;
   auxlh[1].y = basehatch[1].y;

   for ( i=1; i<5; i++ ) {

     DspUtlRotationPoints ( ang, p, basehatch, npointsBh );
     GraPolyLine ( npointsBh, basehatch );
     basehatch[0].x = auxlh[0].x + ( size * 0.15 * i );
     basehatch[0].y = auxlh[0].y;
     basehatch[1].x = auxlh[1].x + ( size * 0.15 * i );
     basehatch[1].y = auxlh[1].y;
   }
}

#endif

